//ActionScript zur Kommunikation mit dem Webserver
//für die Seite userAdministration.mxml
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.utils.ArrayUtil;
import components.userAdministration.newUser;

[Bindable]
private var dpUser:ArrayCollection;

function init():void{
	threepv_service.getUser.send();
}

function getUserResult(event:ResultEvent):void{
	dpUser = new ArrayCollection(ArrayUtil.toArray(event.result));
}

function addUser(vorname, name, login, email, passwort):void{
	threepv_service.addUser.send(vorname, name, login, email, passwort);
}

function addUserResult(event:ResultEvent):void{
	if(event.result){
		navigateToURL(new URLRequest('index.php?content=userAdministration'), '_parent');
	}
}
		
function logoutResult(event:ResultEvent):void{
	if(event.result){
		navigateToURL(new URLRequest('index.php'), '_parent');
	}
}